import requests

from config import BASE_URL

# 定义管理员登录返回token
# 默认管理员账号
def login_token(body={"mobile": "13800000002", "password": "123456"}):
    url = BASE_URL + "/api/sys/login"
    headera = {
        "Content-Type":"application/json"
    }
    res = requests.post(url,headers=headera,json=body)
    token ="Bearer "+ res.json()["data"]
    headers = {
        "Authorization":token
    }
    return headers

if __name__ == '__main__':
     res =login_token(body={"mobile": "13800000001", "password": "123456"})
     print(res)